home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / BSP Tree 1.2 / Sources / Graphics / include / tuple_3d.h < prev    next >
Encoding:
Text File  |  1995-03-25  |  3.0 KB  |  54 lines  |  [TEXT/MMCC]

  1. //------------------------------------------------------------------------------
  2. //    File:                    tuple_3d.h
  3. //    Date:                    8/26/94
  4. //    Author:                Bretton Wade
  5. //
  6. //    Description:    this file contains the class definition for a tuple_3d
  7. //
  8. //------------------------------------------------------------------------------
  9.  
  10. #include "coord.h"
  11.  
  12. #ifndef    TUPLE
  13. #define    TUPLE
  14.  
  15. //------------------------------------------------------------------------------
  16. //    classes
  17. //------------------------------------------------------------------------------
  18. class    tuple_3d                                                                                                                                    //    4 dimensional tuple_3d class
  19. {                                                                                                                                                                //    begin tuple_3d class definition
  20.     private:                                                                                                                                            //    members internal to this class only
  21.     protected:                                                                                                                                        //    members internal to this class hierarchy
  22.                 real    xyz[4];                                                                                                                        //    4 tuple_3d
  23.     public:                                                                                                                                                //    members available externally
  24.                 tuple_3d (void) {}                                                                                                            //    default constructor
  25.                 tuple_3d (const tuple_3d &t);                                                                                        //    copy constructor
  26.                 tuple_3d (real x, real y, real z, real w);                                                            //    constructor from 4 values
  27.                 void    operator = (const tuple_3d &t);                                                                        //    assignment operator
  28.                 bool    operator == (const tuple_3d &t) const;                                                        //    equality operator
  29.                 bool    operator != (const tuple_3d &t) const;                                                        //    inequality operator
  30.                 void    operator () (real x, real y, real z, real w);                                            //    function call operator
  31.                 real    operator | (const tuple_3d &t) const;                                                            //    inner product operator
  32.                 real    operator [] (coord c) const;                                                                            //    array reference operator
  33.                 real    &operator [] (coord c);                                                                                        //    array reference operator
  34.                 coord    MajorAxis (void) const;                                                                                        //    return the major axis of the tuple_3d
  35.                 coord    MinorAxis (void) const;                                                                                        //    return the minor axis of the tuple_3d
  36. };                                                                                                                                                            //    end tuple_3d class definition
  37.  
  38. //------------------------------------------------------------------------------
  39. //    inlines
  40. //------------------------------------------------------------------------------
  41. inline    real    tuple_3d::operator [] (coord c) const                                                            //    array reference operator
  42. {                                                                                                                                                                //    begin
  43.     return xyz[c];                                                                                                                                //    return the appropriate coordinate of the tuple_3d
  44. }                                                                                                                                                                //    end
  45.  
  46. //------------------------------------------------------------------------------
  47. inline    real    &tuple_3d::operator [] (coord c)                                                                    //    array reference operator
  48. {                                                                                                                                                                //    begin
  49.     return xyz[c];                                                                                                                                //    return the appropriate coordinate of the tuple_3d
  50. }                                                                                                                                                                //    end
  51.  
  52. //------------------------------------------------------------------------------
  53.  
  54. #endif    //TUPLE